package com.xuxiao.mapper;


import com.xuxiao.entrty.UserInfo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserInfoMapper {
    @Select("SELECT * FROM userinfo where  username=#{username} and password=#{password}")
    UserInfo getByUsernameAndPassword(String username, String password);

    void InsertNewUser(UserInfo userInfo);

    @Select("SELECT COUNT(*) FROM userinfo where username=#{username}")
    int SelectByNameIsSame(String username);

    @Select("SELECT * from  userinfo")
    List<UserInfo> SelectAllUserInformation();

    void UpdateUserByID(UserInfo userInfo);

    @Select("SELECT username,PID,telephone,address,image,creat ,birthday from userinfo where customerID=#{customerID}")
    UserInfo SelectByID(String customerID);


    void deleteById(List<Integer> ids);

    @Select("SELECT customerID,username,pid,telephone,address,image,creat,birthday from userinfo where username=#{name}")
    List<UserInfo> SelectByName(String name);
}
